#!/bin/sh
#
# /etc/init.d/rcS
#

echo -n "Mounting benchmark tools disk..."
mkdir /mnt/benchtools
/bin/mount /dev/hdb1 /mnt/benchtools
echo "done."

echo -n "Preparing PARSEC runtime environment..."
cd /mnt/benchtools/parsec-2.1/
source env.sh
echo "done."

echo -n "Clearing gem5 Statistics..."
m5 resetstats
echo "done."

echo "Running PARSEC benchmarks..."
parsecmgmt -a run -c scott -d /root -n 8 -i simsmall -p blackscholes -p bodytrack -p facesim -p freqmine -p swaptions -p fluidanimate -p vips -p x264 -p canneal -p streamcluster
echo "Done Running PARSEC benchmarks."

echo -n "Dumping gem5 Statistics..."
m5 dumpstats
echo "done."

echo "Cleaning Up..."
parsecmgmt -a fullclean -c scott -d /root
echo "done."

read -p "Press [Enter] to stop simulator..."

m5 exit
